# @Time    :2025/3/22 22:38
"""
8）从键盘上输入一个时间，输出它的下一秒时间

"""
# hour = int(input("请输入(0-23)之间的整数数字:"))
# minute = int(input("请输入(0-59)之间的整数数字:"))
# second = int(input("请输入(0-59)之间的整数数字:"))
# print(f"当前的时间是:{hour}时{minute}分{second}秒")
#
# second += 1
# if second == 60:
#     second = 0
#     minute += 1
#     if minute == 60:
#         minute = 0
#         hour += 1
#         if hour == 24:
#             hour = 0
# print(f"下一秒的时间为 {hour}时{minute}分{second}秒")


hour = int(input("请输入小时(0-23)之间的整数数字:"))
minute = int(input("请输入分钟(0-59)之间的整数数字:"))
second = int(input("请输入秒(0-59)之间的整数数字:"))

if (0 <= hour < 24) and (0 <= minute < 60) and (0 <= second < 60):
    print(f"当前时间为{hour}时{minute}分{second}秒")
    second += 1
    if second == 60:
        second = 0
        minute += 1
        if minute == 60:
            minute = 0
            hour += 1
            if hour == 24:
                hour = 0
    print(f"当前时间的下一秒为 {hour}时{minute}分{second}秒")
else:
    print("输入的不合法")
    exit(1)
